package com.validators;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import com.view.BaseView;

public class ObjectIDValidator implements
		ConstraintValidator<ObjectSelected, BaseView> {

	private String property;

	// private Logger log = Logger.getLogger(ObjectIDValidator.class);

	public void initialize(ObjectSelected objectID) {
		property = objectID.property();
	}

	public boolean isValid(BaseView objeto, ConstraintValidatorContext cvContext) {

		boolean ret = true;

		// Veo si se seleccionó el objeto
		if (objeto.getId() == null) {
			ret = false;
		}

		return ret;
	}

	public boolean isValid(String objeto, ConstraintValidatorContext cvContext) {

		boolean ret = true;

		// Veo si se seleccionó el objeto

		return ret;
	}
}